Authentication
IMPORTANT - VALID USERS
- john/doe - entitled
- foo/bar - non entitled
The authentication flows involves any process where the user is authenticated, using user/password, refresh tokens, or anyother straregy.
Involved files
src/
Containers/
App/
TVAppContent.js --> Check auth status
views/
Login/ --> Login view
Pairing/ --> Pairing view
context/
AuthContext.js --> Context to share the auth status within the app
services/
auth.js --> Logic for all the auth flows
Flows
Check auth status
This flow is part of the boot process. Usually in all our applications we need to discriminate between authenticated users and unauthenticated ones.
On the src/Containers/App/TVAppContent.js
file we check the status of the user, trying to refresh the auth token if possible.
Login with user/password
This is a regular flow.
We have implemented a login screen on the src/views/Login
folder. It contains a funtional keyboard, some input boxes and common buttons.
Pair device
This is also a common flow for CTV devices.
Instead of use a login/password approach, here we ask the end user to go to a URL to login and input the exposed code.
Logout
Finally we have included a logout flow from the profile screen.
This action cleans the user status of the application.
This will allow you to check how the application changes between different use states without the need of reload it.